/* eslint-disable no-unused-vars */
import axios from "axios";

export default {
    //封装get请求
    get(url) {
        return new Promise(function (resolve, reject) {
           
            axios.get(url).then((res) => {
                resolve(res)
            }).catch(error=>{
                reject(error)
            })
        })
    },
    //封装post请求
    post(url,data) {
        return new Promise(function (resolve, reject){
            axios.post(url,data).then((res)=>{
                resolve(res)
            }).catch(error=>{
                reject(error)
            })
        })
    }
    
}
